package com.leadingsoft.pwxk.converter;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;

import com.leadingsoft.common.converter.AbstractConverter;
import com.leadingsoft.pwxk.dto.AuditPerformReportDto;
import com.leadingsoft.pwxk.model.AuditPerformReport;

@Component
public class AuditPerformReportConverter extends AbstractConverter<AuditPerformReport, AuditPerformReportDto> {

	@Override
	protected AuditPerformReportDto toDtoActual(AuditPerformReport model) {
		AuditPerformReportDto dto = new AuditPerformReportDto();
		BeanUtils.copyProperties(model, dto);
		return dto;
	}

	@Override
	public void copyProperties(AuditPerformReport model, AuditPerformReportDto dto) {

	}

	public List<AuditPerformReportDto> toListDto(List<AuditPerformReport> list) {
		List<AuditPerformReportDto> dtos = new ArrayList<AuditPerformReportDto>();
		list.forEach(t -> {
			dtos.add(toDtoActual(t));
		});
		return dtos;
	}

}
